<?php

require_once dirname(__FILE__) . '/config.php';
require_once 'SessionDelegate.php';
require_once 'Text/Highlighter.php';
require_once 'Text/Highlighter/Renderer/Html.php';

$session =& SessionDelegate::getInstance();
if ($response_body = $session->get('response_body')) {
    $highlighter =& Text_Highlighter::factory('HTML');
    $renderer =& new Text_Highlighter_Renderer_Html(
        array(
            'numbers' => HL_NUMBERS_OL,
            'tabsize' => 2
        )
    );
    $highlighter->setRenderer($renderer);
    $response_body = $highlighter->highlight(trim($response_body));
    header('Content-Type: text/plain;charset=UTF-8');
    echo $response_body;
}
exit;
